package com.tl.commonlibrary.ui.web;

import android.webkit.WebView;

import com.tl.commonlibrary.network.NetConfig;
import com.tl.commonlibrary.tool.DeviceUtil;
import com.tl.commonlibrary.tool.UIUtils;
import com.tl.libmanager.DemandEntrance;
import com.tl.libmanager.MainAppInterface;
import com.tl.libmanager.PluginManager;

/**
 * Created by Administrator on 2017/6/5 0005.
 */

public class NativeJsScope {
    /**
     * html跳html页面统一方法
     *
     * @param view
     * @param suffix
     */
    public static void linktohtml(WebView view, String suffix) {

    }

    public static void login(WebView view) {
        MainAppInterface mainAppInterface = PluginManager.get().getMainAppEntrance();
        if (mainAppInterface != null) {
            mainAppInterface.login(view.getContext());
        }
    }

    public static void tel(WebView view, String phone) {
        DeviceUtil.dial(view.getContext(), phone);
    }

//
//    /**
//     * 启动指定qq聊天
//     */
//    public static void qq(WebView view, String qq) {
//        MainAppInterface mainAppInterface = PluginManager.get().getMainAppEntrance();
//        if (mainAppInterface != null) {
//            if (mainAppInterface.checkLogin(view.getContext())) {
//                UIUtils.onStartService(view.getContext(), qq);
//            }
//        }
//    }
//
//    /**
//     * 启动客服
//     *
//     * @param view
//     */
//    public static void service(WebView view) {
//        UIUtils.startService(view.getContext());
//      //  EventBus.getDefault().post(new ToCustomerChatEvent());
//    }

}
